$OpenBSD: patch-libbacktrace_backtrace_c,v 1.4 2016/03/11 19:46:13 sthen Exp $

- __builtin_return_address() and __builtin_frame_address()
  may not always have a !0 argument.

--- libbacktrace/backtrace.c.orig	Thu Mar  3 10:15:09 2016
+++ libbacktrace/backtrace.c	Thu Mar  3 10:15:38 2016
@@ -65,6 +65,7 @@ bt_create_backtrace(void **buffer, int depth, int flag
 		/* number of HANDLE_FRAME must match BT_MAX_DEPTH */
 		switch (i) {
 		HANDLE_FRAME(0, i, addr);
+#ifndef __BUILTIN_HACK
 		HANDLE_FRAME(1, i, addr);
 		HANDLE_FRAME(2, i, addr);
 		HANDLE_FRAME(3, i, addr);
@@ -192,6 +193,7 @@ bt_create_backtrace(void **buffer, int depth, int flag
 		HANDLE_FRAME(125, i, addr);
 		HANDLE_FRAME(126, i, addr);
 		HANDLE_FRAME(127, i, addr);
+#endif
 		default:
 			goto done;
 		}
